import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common';
import { BossSpiderService } from './boss-spider.service';
import { CreateBossSpiderDto } from './dto/create-boss-spider.dto';
import { UpdateBossSpiderDto } from './dto/update-boss-spider.dto';

@Controller('boss-spider')
export class BossSpiderController {
  constructor(private readonly bossSpiderService: BossSpiderService) {}

  @Get('start-spider')
  startSpider() {
    this.bossSpiderService.startSpider()
  }

  @Post()
  create(@Body() createBossSpiderDto: CreateBossSpiderDto) {
    return this.bossSpiderService.create(createBossSpiderDto);
  }

  @Get()
  findAll() {
    return this.bossSpiderService.findAll();
  }

  @Get(':id')
  findOne(@Param('id') id: string) {
    return this.bossSpiderService.findOne(+id);
  }

  @Patch(':id')
  update(@Param('id') id: string, @Body() updateBossSpiderDto: UpdateBossSpiderDto) {
    return this.bossSpiderService.update(+id, updateBossSpiderDto);
  }

  @Delete(':id')
  remove(@Param('id') id: string) {
    return this.bossSpiderService.remove(+id);
  }
}
